package Work01;
/*编写测试类，创建一个Student对象，并在try{}中调用setXxx()方法为对象属性赋值，在catch()中打印年龄错误。*/
public class Test {
    public static void main(String[] args) {
Student student=new Student();

try{student.setSex("男");
    student.setAge(77);

} catch (SexException sex) {
    sex.printStackTrace();
    System.out.println("性别错误");
}catch (AgeException age){
    age.printStackTrace();
    System.out.println("年龄错误");
}
        System.out.println("程序还在往下执行");
        System.out.println("程序还在执行");
        System.out.println("程序还执行");
        System.out.println("程序还行");
    }
}
